﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    x:Class="Angerona.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--Animazioni e Transizioni-->
    
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="ANGERONA" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Home" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.5*"/>
                <ColumnDefinition Width="0.5*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Button Grid.Row="0" 
                    Grid.Column="0" 
                    Grid.ColumnSpan="2" 
                    Margin="0,0,0,0"
                    Background="{StaticResource PhoneAccentBrush}" 
                    Click="btn_vehicles_Click"
                    BorderThickness="0"
                    MouseEnter="btn_vehicles_Pressed"
                    MouseLeave="btn_vehicles_Leaves">
                <StackPanel>
                    <Image x:Name="vehicleImage" Source="/Img/AppIcons/Angerona_62_62.png" Stretch="Fill" Height="130" Width="130"/>
                    <TextBlock
                    Text="{Binding LocalizedResources.vehicles, Source={StaticResource LocalizedStrings}}" 
                    x:Name="btn_vehicles" HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Grid.Row="1" 
                    Grid.Column="0" 
                    Margin="0,0,0,0" 
                    Background="{StaticResource PhoneAccentBrush}" 
                    BorderThickness="0"
                    MouseEnter="btn_user_Pressed" 
                    MouseLeave="btn_user_Leaves"
                    Click="btn_user_Click">
                <StackPanel>
                    <Image x:Name="userImage" Source="/Img/AppIcons/user_100_100.png" Stretch="Fill" Height="110" Width="110"/>
                    <TextBlock
                    Text="{Binding LocalizedResources.homeName, Source={StaticResource LocalizedStrings}}" 
                    x:Name="btn_user" HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Grid.Row="1" 
                    Grid.Column="1" 
                    Margin="0,0,0,0" 
                    Background="{StaticResource PhoneAccentBrush}" 
                    BorderThickness="0"
                    MouseEnter="btn_settings_Pressed"
                    MouseLeave="btn_settings_Leaves" 
                    Click="Settings_Button_Click">
                <StackPanel>
                    <Image x:Name="settingsImage" Source="/Img/AppIcons/settings_100_100.png" Stretch="Fill" Height="100" Width="100"/>
                    <TextBlock
                    Text="{Binding LocalizedResources.settings, Source={StaticResource LocalizedStrings}}" 
                    x:Name="btn_settings" HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Grid.Row="2" 
                    Grid.Column="0" 
                    Margin="0,0,0,0" 
                    Background="{StaticResource PhoneAccentBrush}" 
                    BorderThickness="0"
                    MouseEnter="btn_help_Pressed"
                    MouseLeave="btn_help_Leaves">
                <StackPanel>
                    <Image x:Name="helpImage" Source="/Img/AppIcons/help_100_100.png" Stretch="Fill" Height="100" Width="100"/>
                    <TextBlock
                    Text="{Binding LocalizedResources.title_about, Source={StaticResource LocalizedStrings}}" 
                    x:Name="btn_help" HorizontalAlignment="Center" />
                </StackPanel>
                <i:Interaction.Triggers>
            		<i:EventTrigger EventName="Click">
            			<ec:NavigateToPageAction TargetPage="/Views/Help.xaml"/>
            		</i:EventTrigger>
            	</i:Interaction.Triggers>
            </Button>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>
